#coding=utf8

from socket import *
from time import ctime

host = ''
port = 12345
BUF_SIZE = 1024
s_addr = (host,port)

server = socket(AF_INET,SOCK_DGRAM)
server.bind(s_addr)

while True:
	print('waiting for message....')
	data,addr = server.recvfrom(BUF_SIZE)
	server.sendto('[%s] %s'%(ctime(),data),addr)
	print('...receive message : %s'%data)
	
server.close()